package JavaUtils.net.socket;

import java.io.UnsupportedEncodingException;

import JavaUtils.CSUtils.CBytes;
import JavaUtils.CSUtils.Log.CLog;

public abstract class C2t4lLogic {
	static final String tag = "C_2t4lLogic";
	public CTcpClient2T4L o_tcp() {
		return _tcp;
	}

	CTcpClient2T4L _tcp;
	public C2t4lLogic S_Clone(CTcpClient2T4L tcp) {
         //CLogic obj = this.Clone() as CLogic;
         CLog.i(tag,"新对象连接成功..........................\n\n\n");
         C2t4lLogic obj = this.S_GetNewObj();
         //C_Debug.LogFormat("克隆对象.................C_TcpClient2T4L.CLogic.{0}", obj.GetHashCode());
         obj._tcp = tcp;
         return obj;
    }

	public C2t4lLogic S_GetNewObj() { return null;  }


	protected String msg;
	public void S_MessageHandle(short msgType,byte[] bytes) throws UnsupportedEncodingException {
         //CLog.LogFormat("拷贝失败____TCP——收到----{0}---{1}--", msgType , msg);
		 bytes = CBytes.subBytes(bytes, 6);
         msg = new String(bytes,"utf-8");// Encoding.UTF8.GetString(bytes, 6, bytes.length - 6);
         //byte[] bytes0 = msg.getBytes();
	}

	public void S_MessageHandle(byte moduleType,byte msgType,byte[] bytes) throws UnsupportedEncodingException {
         //CLog.LogFormat("拷贝失败____TCP——收到-----{0}---{1}----{2}-", moduleType, msgType, msg);
		 bytes = CBytes.subBytes(bytes, 6);
         msg =new String(bytes,"utf-8");
	}

	public void S_Clese() {}

}
